from time import sleep

from ppyy.Redis import RedisClient
from ppyy.autoSubmit import PaperYY


if __name__ == '__main__':
    r = RedisClient()
    while True:
        paper = r.GetPaper()
        print(paper)
        bot = PaperYY()
        if paper:
            title = paper.split('$6350$')[0]
            author = paper.split('$6350$')[1]
            content = paper.split('$6350$')[2]
            bot.submit(title=title, author=author,content=content)
        else:
            print('休眠10秒..')
            sleep(10)
